home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / amazin1a / form5.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-10  |  3.0 KB  |  106 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form Form5 
  4.    Caption         =   "Description"
  5.    ClientHeight    =   5805
  6.    ClientLeft      =   60
  7.    ClientTop       =   390
  8.    ClientWidth     =   4635
  9.    LinkTopic       =   "Form5"
  10.    ScaleHeight     =   5805
  11.    ScaleWidth      =   4635
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.CommandButton Command3 
  14.       Caption         =   "Save"
  15.       Height          =   375
  16.       Left            =   1800
  17.       TabIndex        =   3
  18.       Top             =   5400
  19.       Width           =   1335
  20.    End
  21.    Begin MSComDlg.CommonDialog CommonDialog1 
  22.       Left            =   4680
  23.       Top             =   5280
  24.       _ExtentX        =   847
  25.       _ExtentY        =   847
  26.       _Version        =   393216
  27.    End
  28.    Begin VB.CommandButton Command2 
  29.       Caption         =   "Copy"
  30.       Height          =   375
  31.       Left            =   120
  32.       TabIndex        =   2
  33.       Top             =   5400
  34.       Width           =   1575
  35.    End
  36.    Begin VB.CommandButton Command1 
  37.       Caption         =   "Quit"
  38.       Height          =   375
  39.       Left            =   3240
  40.       TabIndex        =   1
  41.       Top             =   5400
  42.       Width           =   1335
  43.    End
  44.    Begin VB.TextBox Text1 
  45.       Height          =   5295
  46.       Left            =   0
  47.       MultiLine       =   -1  'True
  48.       ScrollBars      =   3  'Both
  49.       TabIndex        =   0
  50.       Top             =   0
  51.       Width           =   4575
  52.    End
  53. Attribute VB_Name = "Form5"
  54. Attribute VB_GlobalNameSpace = False
  55. Attribute VB_Creatable = False
  56. Attribute VB_PredeclaredId = True
  57. Attribute VB_Exposed = False
  58. Private Sub Command1_Click()
  59. Unload Me
  60. End Sub
  61. Private Sub Command2_Click()
  62. MsgBox "Put copy to clipboard code HERE!"
  63. End Sub
  64. Private Sub Command3_Click()
  65. Dim file1
  66. file:
  67. CommonDialog1.Filter = "(*.txt)|*.txt|"
  68. CommonDialog1.ShowSave
  69. If CommonDialog1.filename = "" Then
  70.   MsgBox "You did not enter any file name !"
  71.   Exit Sub
  72. Dim Strtemp, rep2
  73. rep2 = Dir(CommonDialog1.filename)
  74. Strtemp = Mid(CommonDialog1.filename, (Len(CommonDialog1.filename) - Len(rep2)) + 1, Len(rep2))
  75.  If rep2 = Strtemp Then
  76.    Dim rep
  77.    rep = MsgBox("The file already exist do you want to replace it ?", vbQuestion + vbYesNoCancel, "File Overwrite !!")
  78.    If rep = vbNo Then
  79.      GoTo file:
  80.    ElseIf rep = vbYes Then
  81.      Kill CommonDialog1.filename
  82.    Else
  83.      Exit Sub
  84.    End If
  85.  End If
  86.  file1 = FreeFile
  87.  EndStatement = "End Sub"
  88.  If InStr(1, StringToFind, "Function") <> 0 Then EndStatement = "End Function"
  89.  Open CommonDialog1.filename For Output As file1
  90.  Write #file1, Text1.Text
  91.  Close file1
  92. End If
  93. End Sub
  94. Private Sub Form_Load()
  95.  Me.Caption = StringToFind
  96. End Sub
  97. Private Sub Form_Resize()
  98. If Me.WindowState <> 1 Then
  99. Text1.Width = Width - 150
  100. Text1.Height = Height - 1200
  101. Command1.Top = Height - 915
  102. Command2.Top = Height - 915
  103. Command3.Top = Height - 915
  104. End If
  105. End Sub
  106.